<table cellpadding="0" cellspacing="0" border="0" class="zebra com_list">
	<thead class="fields">
		<tr class="title">
			<th class="first left" colspan="6"><h3><?php echo ucfirst($txt->getWord('mine').' '.$txt->getWord('latest_ads')); ?></h3></th>
			<th class="nosort last">&nbsp;</th>
		</tr>
		<tr>
			<th class="first left"><?php echo ucfirst($txt->getWord('type', $words)); ?>&nbsp;&nbsp;&nbsp;&nbsp;</th>
			<th class="left"><?php echo ucfirst($txt->getWord('title', $words)); ?>&nbsp;&nbsp;&nbsp;&nbsp;</th>
			<th class="left"><?php echo ucfirst($txt->getWord('created', $words)); ?>&nbsp;&nbsp;&nbsp;&nbsp;</th>
			<th colspan="2" class="left"><?php echo ucfirst($txt->getWord('published', $words)); ?>&nbsp;&nbsp;&nbsp;&nbsp;</th>
			<th class="center"><?php echo ucfirst($txt->getWord('edit', $words)); ?>&nbsp;&nbsp;&nbsp;&nbsp;</th>
		</tr>
	</thead>
	<tbody>
	<?php 
		if($adc->getUserAds())
		{
			$out  = '';
			$types  = $adc->getAdTypes();
			$adcats = $adc->getAdCats();
			$brands = $adc->getAdBrands();
			$i=0;
			foreach($adc->getUserAds() as $item)
			{
				if($i < 10)
				{
					?>
					<tr class="items">
						<td class="first left" style="overflow:hidden;"><?php echo ucfirst($item->getIsBuyingText()); ?>&nbsp;</td>
						<td class="left"><?php echo $txt->truncate($item->getTitle(), 20); ?>&nbsp;&nbsp;</td>
						<td class="left nowrap"><?php echo substr($item->getDateCreated(), 0, 10); ?>&nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td class="left">
							<?php 
							if($item->getActive() > 0)
							{ echo $item->formatDateTime($item->getDateActiveStart(), 'd.m.y').'&nbsp;'; }
							else
							{ echo ucfirst($txt->getWord('no', $words)).'&nbsp;'; }
							?>
						</td>
						<td class="left">
						<?php
						if($item->getIsCompleted() > 0)
						{
							if($item->getIsPaid() > 0)
							{ echo '<a href="/c/'.$com->getComId().'?activate='.$item->getId().'"><img title="'.ucfirst($txt->getWord('publish', $words).' '.$txt->getWord('again', $words)).'" class="icon command" src="'.SYSICONS_URL.'refresh_16.gif" /></a>';}
						}
						else
						{
							if($item->getActive() > 0)
							{ echo '<a href="/c/'.$com->getComId().'?complete='.$item->getId().'"><img title="'.ucfirst($item->getIsBoughtText()).'" class="icon command" src="'.SYSICONS_URL.'ok_16.gif" /></a>'; }
							else
							{ 
								if($item->getIsPaid() > 0)
								{ echo '<a href="/c/'.$com->getComId().'?activate='.$item->getId().'"><img title="'.ucfirst($txt->getWord('publish', $words)).'" class="icon command" src="'.SYSICONS_URL.'ready_16.gif" /></a>';}
								else
								{ echo '<a href="/c/'.$com->getComId().'?edit=payment&amp;ad='.$item->getId().'"><img title="'.ucfirst($txt->getWord('pay', $words)).'" class="icon command" src="'.SYSICONS_URL.'shop_16.png" /></a>'; }
							}
						}
						?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
						<td class="left">
							<a href="/c/<?php echo $com->getComId(); ?>?edit=ad&amp;ad=<?php echo $item->getId() ?>"><img title="<?php echo ucfirst($txt->getWord('edit', $words).' '.$txt->getWord('ad', $words)); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>edit_16.gif" /></a>&nbsp;&nbsp;
							<a href="/c/<?php echo $com->getComId(); ?>?edit=ad&amp;ad=<?php echo $item->getId() ?>&amp;view=images"><img title="<?php echo ucfirst($txt->getWord('edit').' '.$txt->getWord('images')); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>images_16.png" /></a>
						</td>
						<td class="last center">
						<?php 
						if(($item->getIsPaid() > 0) && ($item->getActive() > 0))
						{ echo '<img title="'.ucfirst($txt->getWord('archive', $words).' '.$txt->getWord('ad', $words)).'" class="icon command" src="'.SYSICONS_URL.'archive_16.png" />'; }
						else
						{ 
							if(($item->getIsPaid() > 0) || ($item->getOrderId() == 0))
							{ echo '<img title="'.ucfirst($txt->getWord('delete', $words).' '.$txt->getWord('ad', $words)).'" class="icon command" src="'.SYSICONS_URL.'delete_16.gif" onclick="deleteAdDialog('.$item->getId().');" />'; }
						}
						?>
						&nbsp;
						</td>
					</tr>
					<?php
				}
				$i++;
			}
		}
		else
		{
			$out  = '<tr class="items">';
			$out .= 	'<td class="first">&nbsp;</td>';
			$out .= 	'<td>'.ucfirst($txt->getWord('no_items', $words)).'</td>';
			$out .= 	'<td>&nbsp;</td>';
			$out .= 	'<td>&nbsp;</td>';
			$out .= 	'<td>&nbsp;</td>';
			$out .= 	'<td class="last center">&nbsp;</td>';
			$out .= '</tr>';
		}
		echo $out;
		?>
	</tbody>
</table>